#ifndef PBCVC_H
#define PBCVC_H

#define OUT
#define IN

extern "C"
{
	int generatePubKey(OUT unsigned char *priR, OUT unsigned char *priX, OUT unsigned char *priO,
					   OUT unsigned char *pubR, OUT unsigned char *pubA, OUT unsigned char *pubH,
					   IN int keyLength, IN int *firstPriKeyLength, IN const unsigned char * generator);

	int generateGroupPubKey(IN const unsigned char *singlePubKeyA, IN const unsigned char *singlePubKeyB,
							OUT unsigned char *result, IN int keyLength, IN int type);

	int encryption(OUT unsigned char* ciphertext1, OUT unsigned char* ciphertext2, OUT unsigned char* ciphertext3,
				   IN const unsigned char* pubR, IN const unsigned  char* pubA, IN const unsigned char* plaintext,
				   IN const unsigned char* generator, IN int keyLength);

	int decryption(IN const unsigned char* ciphertext1, IN const unsigned char* ciphertext2, IN const unsigned char* ciphertext3,
				   IN const unsigned char *pubO, IN const unsigned char *pubH, OUT unsigned char *plaintext, IN int keyLength);

	int computeOtherO(IN unsigned char* myPriX,IN unsigned char *otherPubH,IN unsigned char* myPriR,
					  IN int keyLength, OUT unsigned char *otherPubO);

	int computeDecryptKey(IN unsigned char *myPriO, IN unsigned char *otherPubO,
						  OUT unsigned char *decryptKey,int keyLength);

	int generateAESKey(OUT unsigned char *AESKey,int keyLength);
}
#endif // PBCVC_H
